package com.example.demo.test.leetcode.day1213;

import java.util.*;
import java.util.stream.IntStream;

public class Solution1213 {
    public static void main(String[] args) {
        System.out.println(containsDuplicate(new int[]{1,2,3}));
    }

    public static boolean containsDuplicate(int[] nums) {
        HashSet<Integer> hashSet = new HashSet<>();
        for (int num : nums) {
            if(hashSet.contains(num))
                return true;
            else
             hashSet.add(num);
        }
        return false;
    }

    public static boolean myTest(int[] nums) {
        IntStream stream = Arrays.stream(nums);

        return false;
    }
}
